<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="Content-Style-Type" content="text/css">
<title></title>
<meta name="Generator" content="Cocoa HTML Writer">
<meta name="CocoaVersion" content="824.48">
<style type="text/css">
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 18.0px Helvetica}
p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px}
p.p3 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica}
p.p4 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco; color: #a71d0f}
p.p5 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco}
p.p6 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco; color: #a71d0f; min-height: 12.0px}
p.p7 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco; min-height: 12.0px}
span.s1 {color: #0013fe}
span.s2 {color: #0022b7}
span.Apple-tab-span {white-space:pre}
</style>
</head>
<body>
<p class="p1"><b>FFTSlope<span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>Spectral slope</b></p>
<p class="p2"><br></p>
<p class="p3"><b><span class="Apple-tab-span">	</span>FFTSlope.kr(chain)</b></p>
<p class="p2"><br></p>
<p class="p3">Given an <a href="SC://FFT"><span class="s1">FFT</span></a> <b>chain</b>, this measures the <i>spectral slope</i>, which is the slope of the linear correlation line derived from the spectral magnitudes.</p>
<p class="p2"><br></p>
<p class="p2"><br></p>
<p class="p3"><b>Example</b></p>
<p class="p2"><br></p>
<p class="p4">// Very artificial example - just filtering some noise.</p>
<p class="p5">s.boot;</p>
<p class="p5">b = <span class="s2">Buffer</span>.alloc(s,2048,1);</p>
<p class="p5">(</p>
<p class="p5">x = {</p>
<p class="p5"><span class="s2">var</span> in, chain, freq, val;</p>
<p class="p6"><br></p>
<p class="p5">freq = <span class="s2">MouseX</span>.kr(20000, 1000, 1);</p>
<p class="p7"><br></p>
<p class="p5">in = <span class="s2">LPF</span>.ar(<span class="s2">WhiteNoise</span>.ar, freq);</p>
<p class="p7"><br></p>
<p class="p5">chain = <span class="s2">FFT</span>(b.bufnum, in);</p>
<p class="p7"><br></p>
<p class="p5">val = <span class="s2">FFTSlope</span>.kr(chain);</p>
<p class="p7"><br></p>
<p class="p5"><span class="s2">Out</span>.ar(0, in.dup * 0.1);</p>
<p class="p5">(val * 10000).poll(10); // Poll but scaled so more readable!</p>
<p class="p5">}.play(s);</p>
<p class="p5">)</p>
<p class="p7"><br></p>
<p class="p5">x.free;</p>
</body>
</html>
